import http from '@src/util/http';

/**
 * 新建故障对象/新建描述/新建子描述
 * https://yapi.shb.ltd/project/5164/interface/api/52174
 */
export function libraryCreate (params) {
  return http.post('/api/library/outside/fault/library/create', params);
}

/**
 * 新建故障对象/新建描述/新建子描述
 * https://yapi.shb.ltd/project/5164/interface/api/52174
 */
export function libraryEdit (params) {
  return http.post('/api/library/outside/fault/library/edit', params);
}



/**
 * 故障树查询
 * https://yapi.shb.ltd/project/5164/interface/api/52190
 */
export function librarySelect (params) {
  return http.post('/api/library/outside/fault/library/select', params);
}

/**
 * 删除故障对象
 * https://yapi.shb.ltd/project/5164/interface/api/52182
 */
export function libraryDelete (params) {
  return http.get('/api/library/outside/fault/library/delete', params);
}


/**
 * 删除解决方法
 * ttps://yapi.shb.ltd/mock/5164/outside/solution/delete
 */
export function solutionDelete (params) {
  return http.get('/api/library/outside/solution/delete', params);
}



/**
 * 获取解决方法表单
 * https://yapi.shb.ltd/project/5164/interface/api/52154
 */
export function solutionGetFields (params) {
  return http.get('/api/library/outside/solution/getFields', params);
}

/**
 * 保存解决方法表单
 * https://yapi.shb.ltd/project/5164/interface/api/52150
 */
export function solutionSaveFields (params) {
  return http.post('/api/library/outside/solution/saveFields', params);
}

/**
 * 获取解决方法
 * https://yapi.shb.ltd/project/5164/interface/api/52222
 */
export function solutionSearch (params) {
  return http.post('/api/library/outside/solution/search', params);
}

/**
 * 根据id获取解决方法
 * https://yapi.shb.ltd/project/5164/interface/api/52222
 */
export function solutionGetData (params) {
  return http.get('/api/library/outside/solution/getData', params);
}


/**
 * 新建解决方法
 * https://yapi.shb.ltd/project/5164/interface/api/52138
 */
export function solutionCreate (params) {
  return http.post('/api/library/outside/solution/create', params);
}

/**
 * 编辑解决方法
 * https://yapi.shb.ltd/project/5164/interface/api/52142
 */
export function solutionEdit (params) {
  return http.post('/api/library/outside/solution/edit', params);
}


/**
 * 获取故障树层级
 * https://yapi.shb.ltd/project/5164/interface/api/52142
 */
export function getLevel (params) {
  return http.post('/api/library/outside/fault/library/getLevel', params);
}


/**
 * 故障详情接口
 * https://yapi.shb.ltd/mock/5164/outside/fault/library/faultDetail
 */
export function faultDetail (params) {
  return http.post('/api/library/outside/fault/library/faultDetail', params);
}

/**
 * 解决方法对应工单数据查询
 * https://yapi.shb.ltd/project/5164/interface/api/54226
 */
export function getTaskSolutionList (params) {
  return http.post('/api/library/outside/task/fault/card/getTaskSolutionList', params);
}


/**
 * 故障节点对应工单数据查询
 * https://yapi.shb.ltd/project/5164/interface/api/54230
 */
export function getTaskFaultList (params) {
  return http.post('/api/library/outside/task/fault/card/getTaskFaultList', params);
}

/**
 * 工单附加组件故障清单删除
 * https://yapi.shb.ltd/project/5164/interface/api/52162
 */
export function taskFaultCardDelete (params) {
  return http.get('/api/library/outside/task/fault/card/delete', params);
}

/**
 * 工单附加组件故障清单删除
 * https://yapi.shb.ltd/project/5164/interface/api/52162
 */
export function getTaskFaultCardSelect (params) {
  return http.post('/api/library/outside/task/fault/card/select', params);
}

/**
 * @description - 工单绑定故障新增-单个
 * @param {Object} params - 参数
 */
 export function getTaskCardSave(params) {
  return http.post(`/api/library/outside/task/fault/card/save`, params);
}

/**
* @description - 工单绑定故障新增-多个
* @param {Object} params - 参数
*/
export function getTaskCardSaveList(params) {
  return http.post(`/api/library/outside/task/fault/card/saveList`, params);
}


/**
 * @description - 工单绑定故障更新接口
 * @param {Object} params - 参数
 */
 export function getTaskCardEdit(params) {
  return http.post(`/api/library/outside/task/fault/card/edit`, params);
}
/**
* 根据父节点获取对应的子节点列表数据
 * https://yapi.shb.ltd/project/5164/interface/api/54422
 */
export function searchChildList (params) {
  return http.post('/api/library/outside/fault/library/searchChildList', params);
}

/**
 * 故障注册页面-列表数据
 * https://yapi.shb.ltd/project/5164/interface/api/54354
 */
export function getListData (params) {
  return http.post('/api/library/outside/fault/library/getListData', params);
}


/**
 * 故障注册页面-列表数据
 * https://yapi.shb.ltd/project/5164/interface/api/54354
 */
export function libraryEnter (params) {
  return http.post('/api/library/outside/fault/library/enter', params);
}

// 无权限接口
export function checkFault(params) {
  return http.post('/api/library/outside/fault/library/check/fault/show', params)
}

/**
 * @des 保存未解决提示内容配置
 * @see https://yapi.shb.ltd/project/5164/interface/api/57605
 */
export function saveFaultSettingData(params){
  return http.post('/api/library/outside/fault/library/updateConfig', params)
}

/**
 * @des 未解决提示内容配置
 * @see https://yapi.shb.ltd/project/5164/interface/api/57608
 */
export function getFaultSettingData(params){
  return http.get('/api/library/outside/fault/library/getConfig', params)
}

/**
 * @des 查询评论
 * @see https://yapi.shb.ltd/project/5164/interface/api/57554
 */
export function getRemarkList(params){
  return http.post('/api/library/outside/fault/library/comment/pageData', params)
}

/**
* @des 添加评论
* @see https://yapi.shb.ltd/project/5164/interface/api/57551
*/
export function addRemark(params){
  return http.post('/api/library/outside/fault/library/comment/create', params)
}

/**
 * 
 * @des 故障树复制
 * @see https://yapi.shb.ltd/project/5164/interface/api/57557
 * @param {*} params
 */
export function copyFault(params){
  return http.post('/api/library/outside/fault/library/copy', params)
}